package a.h;

import a.i.l;

import javax.swing.*;
import javax.swing.border.TitledBorder;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.*;

class cb
  extends bb
  implements ib, x
{
  private static final String d = "DefaultEditorFactory.inlineEnabledEditorState";
  private JPanel e;
  private kd f;
  private gb g;
  private final Map h;
  private final Set i;
  
  public cb(kd paramkd, gb paramgb)
  {
    super(paramkd.b());
    this.f = paramkd;
    this.g = paramgb;
    this.i = new HashSet();
    this.h = new HashMap();
    this.e = g();
    this.f = null;
    this.g = null;
  }
  
  public JComponent f()
  {
    return this.e;
  }
  
  private JPanel g()
  {
    int m = ec.t;
    boolean bool = ec.s;
    Object localObject1 = this.f.a(kd.a);
    if (m == 0)
    {
      if (!(localObject1 instanceof String)) {
        break label70;
      }
      if (m != 0) {
        break label67;
      }
    }
    label67:
    label70:
    String str = ((String)localObject1).length() > 0 ? localObject1 + "." : "";
    ac localac = new ac();
    JPanel localJPanel = new JPanel();
    localJPanel.setBorder(BorderFactory.createEmptyBorder(6, 6, 0, 6));
    localJPanel.setLayout(localac);
    cc localcc = null;
    int j = this.f.b();
    int k = 0;
    if (k < j) {}
    do
    {
      ec localec = this.f.b(k);
      localcc = b(localec);
      if (m == 0)
      {
        if (localcc != null)
        {
          Object localObject2 = localcc.a(gb.d);
          localf_ = (f_)this.h.get(localObject2);
          if (m == 0) {
            if (localf_ == null)
            {
              localf_ = new f_();
              this.h.put(localObject2, localf_);
            }
          }
          localf_.a(localcc);
        }
        k++;
      }
      if (!bool) {
        break;
      }
      f_ localf_ = null;
      a(this.f.iterator(), str, localJPanel, localac);
    } while (m != 0);
    Iterator localIterator = this.h.values().iterator();
    if (localIterator.hasNext()) {}
    do
    {
      ((f_)localIterator.next()).d();
      if ((m == 0) && (bool)) {
        break label337;
      }
      if (!bool) {
        break;
      }
      this.h.clear();
    } while (m != 0);
    this.i.clear();
    label337:
    return localJPanel;
  }
  
  private void a(Iterator paramIterator, String paramString, JPanel paramJPanel, ac paramac)
  {
    int k = ec.t;
    boolean bool2 = ec.s;
    Insets localInsets1 = new Insets(3, 3, 4, 4);
    Insets localInsets2 = new Insets(3, 7, 4, 4);
    Insets localInsets3 = new Insets(1, 3, 4, 3);
    Insets localInsets4 = new Insets(1, 3, 4, 7);
    Insets localInsets5 = new Insets(1, 3, 4, 3);
    Insets localInsets6 = new Insets(1, 7, 4, 7);
    double d1 = 0.0D;
    hd localhd1 = new hd();
    localhd1.y = 0;
    localhd1.D = 18;
    localhd1.E = 0;
    localhd1.z = 1;
    localhd1.A = 1;
    localhd1.B = 0.0D;
    localhd1.C = 0.0D;
    localhd1.x = 0;
    localhd1.F = localInsets2;
    hd localhd2 = new hd();
    localhd2.y = 0;
    localhd2.D = 18;
    localhd2.E = 2;
    localhd2.z = 1;
    localhd2.A = 1;
    localhd2.B = 1.0D;
    localhd2.C = 0.0D;
    localhd2.x = 1;
    localhd2.F = localInsets4;
    hd localhd3 = new hd();
    localhd3.D = 18;
    localhd3.E = 1;
    localhd3.z = 2;
    localhd3.A = 1;
    localhd3.B = 1.0D;
    localhd3.C = 0.0D;
    localhd3.x = 0;
    localhd3.y = 0;
    localhd3.F = localInsets6;
    hd localhd4 = new hd();
    localhd4.D = 18;
    localhd4.E = 1;
    localhd4.F.top = 4;
    localhd4.F.bottom = 8;
    localhd4.z = 2;
    localhd4.A = 1;
    localhd4.B = 1.0D;
    localhd4.C = 0.0D;
    localhd4.x = 0;
    localhd4.y = 0;
    hd localhd5 = new hd();
    localhd5.D = 18;
    localhd5.E = 1;
    localhd5.F.top = 4;
    localhd5.F.bottom = 8;
    localhd5.z = 2;
    localhd5.A = 1;
    localhd5.B = 1.0D;
    localhd5.C = 0.0D;
    localhd5.x = 0;
    localhd5.y = 0;
    hd localhd6 = new hd();
    ob localob = this.g.a();
    Comparator local0 = new Comparator()
    {
      public int compare(Object paramAnonymousObject1, Object paramAnonymousObject2)
      {
        return l.a(cb.this.f.indexOf(paramAnonymousObject1), cb.this.f.indexOf(paramAnonymousObject2));
      }
    };
    ArrayList localArrayList = new ArrayList();
    cc localcc1 = null;
    cc localcc2 = null;
    cc localcc3 = null;
    JPanel localJPanel1 = null;
    JPanel localJPanel2 = null;
    e_ locale_ = null;
    Object localObject1 = null;
    label812:
    label825:
    label827:
    Object localObject3;
    label929:
    label941:
    label1085:
    label1092:
    Object localObject2;
    label1327:
    label2124:
    label2126:
    do
    {
      do
      {
        double d2;
        do
        {
          ec localec;
          f_ localf_;
          do
          {
            do
            {
              do
              {
                if (!paramIterator.hasNext()) {
                  break;
                }
                localec = (ec)paramIterator.next();
              } while ((k == 0) && (this.i.contains(localec)));
              if (k == 0)
              {
                localcc1 = a(localec);
                if (localcc1 == null) {}
              }
              else if (!this.i.contains(localcc1))
              {
                if (k != 0) {
                  break label827;
                }
                if (localcc1 == localcc3) {
                  break label812;
                }
                localcc3 = localcc1;
                String str1 = (String)localcc3.a("OptionGroup.title");
                str1 = (k != 0) || (localob != null) ? localob.b(paramString + "GROUP." + str1) : str1;
                localJPanel1 = new JPanel(paramac.a());
                localJPanel1.setBorder(BorderFactory.createTitledBorder(str1));
                locale_ = new e_(localJPanel1);
                paramJPanel.add(localJPanel1, localhd4);
                localhd4.y += 1;
                localhd1.F = localInsets1;
                localhd2.F = localInsets3;
                localhd3.F = localInsets5;
                localhd1.y = 0;
                localhd2.y = 0;
                localhd3.y = 0;
                if (k != 0) {
                  break label825;
                }
                if (!bool2) {
                  break label812;
                }
              }
              localJPanel1 = null;
              locale_ = null;
              localhd1.F = localInsets2;
              localhd2.F = localInsets4;
              localhd3.F = localInsets6;
              localhd1.y = localhd4.y;
              localhd2.y = localhd4.y;
              localhd3.y = localhd4.y;
              if (k == 0)
              {
                localcc2 = b(localec);
                if (localcc2 == null) {
                  break label1327;
                }
              }
              if ((k == 0) && (this.i.contains(localcc2))) {
                break label1327;
              }
              int j = 0;
              if (k == 0)
              {
                if (localcc1 != null)
                {
                  if (k != 0) {
                    break label929;
                  }
                  if (!this.i.contains(localcc1))
                  {
                    this.i.add(localcc1);
                    j = 1;
                  }
                }
                localJPanel2 = new JPanel(new CardLayout());
              }
              localf_ = (f_)this.h.get(localcc2.a(gb.d));
              Iterator localIterator1 = localf_.a();
              if (localIterator1.hasNext()) {}
              do
              {
                localcc2 = (cc)localIterator1.next();
                this.i.add(localcc2);
                localObject3 = new JPanel(paramac.a());
                paramac.addLayoutComponent((Component)localObject3, localhd6);
                localArrayList.clear();
                if (bool2) {
                  break;
                }
                Iterator localIterator2 = localcc2.a();
                do
                {
                  if (!localIterator2.hasNext()) {
                    break;
                  }
                  if (k != 0) {
                    break label1092;
                  }
                  localArrayList.add(localIterator2.next());
                  if (bool2) {
                    break label1085;
                  }
                } while (!bool2);
                l.a(localArrayList, local0);
                if (k == 0) {
                  a(localArrayList.iterator(), paramString, (JPanel)localObject3, paramac);
                }
                localObject4 = localcc2.a("OptionGroup.title");
                if (k == 0)
                {
                  if ((localObject4 instanceof String))
                  {
                    localObject4 = (k != 0) || (localob != null) ? localob.b(paramString + "GROUP." + localObject4) : localObject4;
                    ((JPanel)localObject3).setBorder(BorderFactory.createTitledBorder((String)localObject4));
                  }
                  localJPanel2.add((Component)localObject3, localcc2.a(gb.f));
                }
                if (!bool2) {
                  break label941;
                }
                localf_.a(localJPanel2);
              } while (k != 0);
              localhd5.y = (localJPanel1 != null ? localhd1.y : localhd4.y);
              if (k == 0) {}
              (localJPanel1 != null ? localJPanel1 : paramJPanel).add(localJPanel2, localhd5);
              localhd1.y += 1;
              localhd2.y += 1;
              if (k == 0)
              {
                localhd3.y += 1;
                if (localJPanel1 != null) {}
              }
              else
              {
                localhd4.y += 1;
              }
              if (k != 0) {
                break;
              }
            } while (j == 0);
            this.i.remove(localcc1);
          } while (!bool2);
          localObject2 = nb.a(localec);
          localObject3 = this.g.a(localec);
          this.i.add(localec);
          a((ib)localObject3);
          localObject1 = localec.c(gb.d);
          if ((k != 0) || (localObject1 != null))
          {
            localf_ = (f_)this.h.get(localObject1);
            localf_.a((ib)localObject3);
          }
          if (k == 0) {
            if (locale_ != null) {
              locale_.a((tb)localObject3);
            }
          }
          Object localObject4 = localec.c(gb.e);
          d2 = 0.0D;
          if (k == 0) {
            if (!(localec instanceof qc))
            {
              if ((k == 0) && (!(localObject4 instanceof Number))) {
                break label1559;
              }
              if (k == 0) {
                if (((Number)localObject4).doubleValue() <= 0.0D) {
                  break label1559;
                }
              }
            }
            else
            {
              d2 = 10.0D;
              if (k != 0) {
                break label1552;
              }
            }
          }
          if ((localObject4 instanceof Number))
          {
            if (k != 0) {
              break label1556;
            }
            if (((Number)localObject4).doubleValue() > 0.0D) {
              d2 = ((Number)localObject4).doubleValue();
            }
          }
          localhd3.C = d2;
          localhd2.C = d2;
          localhd3.E = 1;
          localhd2.E = 1;
          d1 += d2;
          String str2 = localec.e();
          if ((str2 == null) && ((k != 0) || (localob != null)))
          {
            str2 = localob.b((String)localObject2 + ".TOOLTIP");
            if (((k != 0) || (str2 != null)) && (str2.endsWith("TOOLTIP"))) {
              str2 = null;
            }
          }
          d_ locald_ = new d_();
          JComponent localJComponent;
          if (localec.g())
          {
            Action localAction = null;
            String str3 = localec.d();
            if (k == 0)
            {
              if (localob != null) {
                str3 = localob.b((String)localObject2);
              }
            }
            else {
              localAction = localob.c((String)localObject2 + ".ONLINE_HELP.URL");
            }
            JLabel localJLabel = new JLabel(str3, 2);
            localJLabel.setVerticalAlignment(1);
            localJLabel.setText(str3);
            a(localJLabel, (ib)localObject3);
            localJLabel.setEnabled(((tb)localObject3).o());
            localObject1 = localec.c("DefaultEditorFactory.inlineEnabledEditorState");
            if ((localObject1 instanceof Boolean))
            {
              JCheckBox localJCheckBox = new JCheckBox();
              localJCheckBox.setMargin(new Insets(0, 0, 0, 0));
              localJCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 3));
              b_ localb_ = new b_(localJLabel, localJCheckBox, (tb)localObject3);
              if (k == 0)
              {
                if ((localObject3 instanceof xc)) {
                  ((xc)localObject3).c("enabled", new PropertyChangeListener()
                  {
                    private final cb.b_ val$_switchListener;
                    private final JCheckBox val$_switch;
                    private final tb val$editor;
                    
                    public void propertyChange(PropertyChangeEvent paramAnonymousPropertyChangeEvent)
                    {
                      this.val$_switchListener.a = false;
                      this.val$_switch.setSelected(this.val$editor.o());
                      this.val$_switchListener.a = true;
                    }
                  });
                }
                localJCheckBox.addActionListener(localb_);
              }
              boolean bool1 = ((Boolean)localObject1).booleanValue();
              localJCheckBox.setSelected(bool1);
              localJLabel.setEnabled(bool1);
              ((tb)localObject3).c(bool1);
              JPanel localJPanel3 = new JPanel(new BorderLayout());
              localJPanel3.add(localJCheckBox, "West");
              localJPanel3.add(localJLabel, "Center");
              if (k == 0) {}
              (localJPanel1 != null ? localJPanel1 : paramJPanel).add(localJPanel3, localhd1);
              if (!bool2) {}
            }
            else
            {
              if (k == 0) {}
              (localJPanel1 != null ? localJPanel1 : paramJPanel).add(localJLabel, localhd1);
            }
            if (localAction != null)
            {
              localJLabel.addMouseListener(locald_);
              localJLabel.putClientProperty("HELP_ACTION_KEY", localAction);
            }
            localJComponent = ((tb)localObject3).f();
            if (k == 0) {}
            (localJPanel1 != null ? localJPanel1 : paramJPanel).add(localJComponent, localhd2);
            localJLabel.setLabelFor(localJComponent);
            if (k != 0) {
              break label2126;
            }
            if (str2 == null) {
              break label2124;
            }
            if (k != 0) {
              break label2126;
            }
            if (str2.trim().length() <= 0) {
              break label2124;
            }
            localJLabel.setToolTipText(str2);
            if (k == 0) {
              if (!bool2) {
                break label2124;
              }
            }
          }
          else
          {
            localJComponent = ((tb)localObject3).f();
          }
          if (k == 0) {}
          (localJPanel1 != null ? localJPanel1 : paramJPanel).add(localJComponent, localhd3);
          if (((k != 0) || (str2 != null)) && ((k != 0) || ((str2.trim().length() > 0) && ((k != 0) || (localJComponent.getToolTipText() == null))))) {
            localJComponent.setToolTipText(str2);
          }
          localhd1.y += 1;
          localhd2.y += 1;
          if (k == 0)
          {
            localhd3.y += 1;
            if (localJPanel1 != null) {}
          }
          else
          {
            localhd4.y += 1;
          }
        } while (d2 <= 0.0D);
        localhd3.C = 0.0D;
        localhd2.C = 0.0D;
        localhd3.E = 2;
        localhd2.E = 2;
      } while (k != 0);
      if ((k == 0) && (bool2)) {
        return;
      }
    } while ((k == 0) && (!bool2));
    label1552:
    label1556:
    label1559:
    if (d1 <= 0.0D)
    {
      localObject2 = new hd();
      ((hd)localObject2).B = 1.0D;
      ((hd)localObject2).C = 1.0D;
      ((hd)localObject2).z = 2;
      ((hd)localObject2).A = 1;
      ((hd)localObject2).x = 0;
      ((hd)localObject2).y = -1;
      ((hd)localObject2).E = 1;
      localObject3 = new JPanel();
      ((JPanel)localObject3).setMinimumSize(new Dimension(0, 0));
      paramJPanel.add((Component)localObject3, localObject2);
    }
  }
  
  private cc a(ec paramec)
  {
    int j = ec.t;
    Object localObject1 = paramec.c(ec.d);
    if ((j != 0) || ((localObject1 instanceof Collection)))
    {
      Iterator localIterator = ((Collection)localObject1).iterator();
      while (localIterator.hasNext())
      {
        cc localcc = (cc)localIterator.next();
        Object localObject2 = localcc.a("OptionGroup.title");
        if (((localObject2 instanceof String)) && ((j != 0) || (localcc.a(gb.d) == null))) {
          return localcc;
        }
      }
    }
    return null;
  }
  
  private cc b(ec paramec)
  {
    int j = ec.t;
    Object localObject1 = paramec.c(ec.d);
    if ((j != 0) || ((localObject1 instanceof Collection)))
    {
      Iterator localIterator = ((Collection)localObject1).iterator();
      while (localIterator.hasNext())
      {
        cc localcc = (cc)localIterator.next();
        Object localObject2 = localcc.a(gb.d);
        if (localObject2 != null) {
          return localcc;
        }
      }
    }
    return null;
  }
  
  private void a(JLabel paramJLabel, ib paramib)
  {
    if ((ec.t != 0) || ((paramib instanceof xc))) {
      ((xc)paramib).c(d.d, new h_(paramJLabel));
    }
  }
  
  private static final class f_
  {
    ib a;
    Collection c = new ArrayList();
    JPanel e;
    
    public cc a(cc paramcc)
    {
      if ((ec.t != 0) || (!this.c.contains(paramcc))) {
        this.c.add(paramcc);
      }
      return paramcc;
    }
    
    public Iterator a()
    {
      return this.c.iterator();
    }
    
    public boolean b()
    {
      return this.c.isEmpty();
    }
    
    public void d()
    {
      this.a = null;
      this.c.clear();
      this.c = null;
      this.e = null;
    }
    
    public void a(ib paramib)
    {
      int i = ec.t;
      this.a = paramib;
      if (((i != 0) || (this.e != null)) && ((i != 0) || ((this.a instanceof xc)))) {
        e();
      }
    }
    
    public void a(JPanel paramJPanel)
    {
      int i = ec.t;
      this.e = paramJPanel;
      if (((i == 0) && ((this.a != null) && (i != 0))) || ((this.a instanceof xc))) {
        e();
      }
    }
    
    private void e()
    {
      ((xc)this.a).c(d.e, new cb.g_(this.e));
      if ((ec.t != 0) || ((this.a instanceof tb)))
      {
        Object localObject = ((tb)this.a).n();
        if (localObject != null) {
          ((CardLayout)this.e.getLayout()).show(this.e, localObject.toString());
        }
      }
    }
  }
  
  private static final class g_
    implements PropertyChangeListener
  {
    private CardLayout a;
    private JPanel c;
    
    public g_(JPanel paramJPanel)
    {
      this((CardLayout)paramJPanel.getLayout(), paramJPanel);
    }
    
    public g_(CardLayout paramCardLayout, JPanel paramJPanel)
    {
      this.a = paramCardLayout;
      this.c = paramJPanel;
    }
    
    public void propertyChange(PropertyChangeEvent paramPropertyChangeEvent)
    {
      Object localObject = paramPropertyChangeEvent.getNewValue();
      if (localObject != null) {
        this.a.show(this.c, localObject.toString());
      }
    }
  }
  
  private static final class e_
    implements PropertyChangeListener
  {
    private final Collection a = new ArrayList();
    private final JComponent c;
    
    public e_(JComponent paramJComponent)
    {
      this.c = paramJComponent;
    }
    
    public void a(tb paramtb)
    {
      this.a.add(paramtb);
      if ((ec.t != 0) || ((paramtb instanceof xc))) {
        ((xc)paramtb).c("enabled", this);
      }
    }
    
    public void b(tb paramtb)
    {
      if (ec.t == 0) {
        if ((paramtb instanceof xc)) {
          ((xc)paramtb).d("enabled", this);
        }
      }
      this.a.remove(paramtb);
    }
    
    public void propertyChange(PropertyChangeEvent paramPropertyChangeEvent)
    {
      a();
    }
    
    private void a()
    {
      int i = ec.t;
      boolean bool2 = ec.s;
      boolean bool1 = false;
      Object localObject = this.a.iterator();
      do
      {
        if (!((Iterator)localObject).hasNext()) {
          break;
        }
        bool1 |= ((tb)((Iterator)localObject).next()).o();
        if ((i == 0) && (bool2)) {
          break label76;
        }
      } while (!bool2);
      if (i == 0) {
        this.c.setEnabled(bool1);
      }
      label76:
      localObject = this.c.getBorder();
      if ((i != 0) || ((localObject instanceof TitledBorder)))
      {
        Color localColor = ad.a(bool1 ? "Label.foreground" : "Label.disabledForeground");
        ((TitledBorder)localObject).setTitleColor(localColor);
      }
    }
  }
  
  private static final class h_
    implements PropertyChangeListener
  {
    private final JComponent a;
    
    public h_(JComponent paramJComponent)
    {
      this.a = paramJComponent;
    }
    
    public void propertyChange(PropertyChangeEvent paramPropertyChangeEvent)
    {
      this.a.setEnabled(((Boolean)paramPropertyChangeEvent.getNewValue()).booleanValue());
    }
  }
  
  private static final class d_
    implements MouseListener, ActionListener
  {
    private JPopupMenu a;
    private Action b;
    private Object d;
    private JMenuItem e = new JMenuItem();
    
    public d_()
    {
      this.e.addActionListener(this);
      this.a = new JPopupMenu();
      this.a.add(this.e);
    }
    
    public void mouseClicked(MouseEvent paramMouseEvent)
    {
      if (paramMouseEvent.isPopupTrigger()) {
        a(paramMouseEvent);
      }
    }
    
    public void mouseEntered(MouseEvent paramMouseEvent)
    {
      if (paramMouseEvent.isPopupTrigger()) {
        a(paramMouseEvent);
      }
    }
    
    public void mouseExited(MouseEvent paramMouseEvent)
    {
      if (paramMouseEvent.isPopupTrigger()) {
        a(paramMouseEvent);
      }
    }
    
    public void mousePressed(MouseEvent paramMouseEvent)
    {
      if (paramMouseEvent.isPopupTrigger()) {
        a(paramMouseEvent);
      }
    }
    
    public void mouseReleased(MouseEvent paramMouseEvent)
    {
      if (paramMouseEvent.isPopupTrigger()) {
        a(paramMouseEvent);
      }
    }
    
    public void a(MouseEvent paramMouseEvent)
    {
      this.d = paramMouseEvent.getSource();
      this.b = ((Action)((JComponent)paramMouseEvent.getComponent()).getClientProperty("HELP_ACTION_KEY"));
      this.e.setText((String)this.b.getValue("Name"));
      this.a.show(paramMouseEvent.getComponent(), paramMouseEvent.getX(), paramMouseEvent.getY());
    }
    
    public void actionPerformed(ActionEvent paramActionEvent)
    {
      this.b.actionPerformed(new ActionEvent(this.d, 1001, (String)this.b.getValue("ActionCommandKey")));
    }
  }
  
  final class b_
    implements ActionListener
  {
    boolean a;
    private final JLabel val$label;
    private final JCheckBox val$_switch;
    private final tb val$editor;
    
    b_(JLabel paramJLabel, JCheckBox paramJCheckBox, tb paramtb)
    {
      this.val$label = paramJLabel;
      this.val$_switch = paramJCheckBox;
      this.val$editor = paramtb;
      this.a = true;
    }
    
    public void actionPerformed(ActionEvent paramActionEvent)
    {
      if (ec.t == 0)
      {
        if (this.a) {
          this.val$label.setEnabled(this.val$_switch.isSelected());
        }
      }
      else {
        this.val$editor.c(this.val$_switch.isSelected());
      }
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.h.cb

 * JD-Core Version:    0.7.0.1

 */